#include "ReportViewer.h"

namespace {
const QString IGRDisplayViewerGuid = "{1B5EA181-A38D-4f42-88B2-6AF74CF6D6C0}";
} // namespace

ReportViewer::ReportViewer(QWidget* parent, QAxObject* report)
    : viewer_(new QAxWidget(parent))

{
    viewer_->setControl(IGRDisplayViewerGuid);
    callReport(report);
}

void ReportViewer::callReport(QAxObject* report)
{
    viewer_->dynamicCall("Report", report->asVariant());
}

void ReportViewer::Start()
{
    viewer_->dynamicCall("Start()");
}

void ReportViewer::Stop()
{
    viewer_->dynamicCall("Stop()");
}

QAxWidget* ReportViewer::viewer() const
{
    return viewer_;
}
